package com.example.presentshopping.ui.fragment

import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import com.example.presentshopping.R
import com.example.presentshopping.config.base.BaseMvpFragment
import com.example.presentshopping.ui.fragment.special.*
import com.flyco.tablayout.SlidingTabLayout

//拼团订单
class SpecialFragment : BaseMvpFragment() {

    private val strTitle = arrayOf("全部","未支付" , "拼团失败" ,"拼团成功", "待收货", "已完成")
   var SpecialViewPager : ViewPager ?=null
    override val layoutId: Int
        get() = R.layout.special_fragment

    override fun initView(view: View?, savedInstanceState: Bundle?) {
        val pageViews = ArrayList<Fragment>()
        pageViews.add(CompleteFragment("")) //"全部"
        pageViews.add(CompleteFragment("1")) //未支付
        pageViews.add(CompleteFragment("6"))//拼团失败
        pageViews.add(CompleteFragment("5"))//拼团成功
        pageViews.add(CompleteFragment("3")) //待收货
        pageViews.add(CompleteFragment("7")) //已完成

        SpecialViewPager =view?.findViewById(R.id.SpecialViewPager)
        view?.findViewById<SlidingTabLayout>(R.id.tablayout)?.setViewPager(SpecialViewPager, strTitle, activity, pageViews)
    }

    override fun onSuccess(data: String?) {}


    override fun onFailure(e: Throwable?, code: Int, msg: String?, isNetWorkError: Boolean) {

    }
}